package com.zihao.blog.validator.constraint;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.zihao.blog.validator.annotation.IdValid;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class IdValidator implements ConstraintValidator<IdValid, String> {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext context) {
        if (StringUtils.isBlank(s) || s.length() != 32) {
            return false;
        }
        return true;
    }
}
